<extend name="Base/common"/>
<block name="body">
	<!-- 标签页导航 -->
	<div class="span9 page_message">
		<section id="contents">
			<ul class="tab-nav nav">
				<li class=""><a href="{:U('lists')}">调单列表</a></li>
				<li class="current"><a href="javascript:;">新增表单<b class="arrow fa fa-sort"></b></a></li>
			</ul>
			<div class="tab-content">
				<!-- 表单 -->
				<form id="form" action="{:U('add?model='.$model['id'])}" method="post" class="form-horizontal">
					<ul id="tab" class="tab-pane in">
						<li class="form-item cf">
							<label class="item-label"><span class="need_flag">*</span>关键词<span
									class="check-tips"></span></label>

							<div class="controls">
								<input type="text" class="text input-large" name="keyword" value="{$data.keyword}">
							</div>
						</li>
						<li class="form-item cf">
							<label class="item-label"><span class="need_flag">*</span>标题<span class="check-tips"></span></label>

							<div class="controls">
								<input type="text" class="text input-large" name="title" value="{$data.title}">
							</div>
						</li>
						<li class="form-item cf">
							<label class="item-label"><span class="need_flag">*</span>封面图片<span class="check-tips">图片高度控制在200px-400px之间</span></label>

							<div class="controls uploadrow2" title="点击修改图片" rel="cover">
								<input type="file" id="upload_picture_cover">
								<input type="hidden" name="cover" id="cover_id_cover" value="{$data.cover}"/>

								<div class="upload-img-box" rel="img">
									<notempty name="data[cover]">
										<div class="upload-pre-item2"><img width="100" height="100"
										                                   src="{$data.cover|get_cover_url}"/></div>
										<em class="edit_img_icon">&nbsp;</em>
									</notempty>
								</div>
							</div>
						</li>

						<li class="form-item cf">
							<label class="item-label"><span class="need_flag">*</span>描述<span class="check-tips"></span></label>

							<div class="controls">
								<label class="textarea input-large">
									<textarea class="text input-large" name="intro">{$data.intro}</textarea>
								</label>
							</div>
						</li>
						<li class="form-item cf toggle-prize_type" style="display:none">
							<label class="item-label"><span class="need_flag">*</span>是否允许编辑<span
									class="check-tips"></span></label>

							<div class="controls">
								<select name="can_edit">
									<volist name=":parse_field_attr($fields['type']['extra'])" id="vo">
										<option value="{$key}"
										<eq name="data[type]" value="$key">selected="selected"</eq>
										>{$vo|clean_hide_attr} </option>
									</volist>
								</select>
							</div>
						</li>
						<li class="form-item cf">
							<label class="item-label">用户提交后提示内容<span class="check-tips">为空默认为：提交成功，谢谢参与</span></label>

							<div class="controls">
								<label class="textarea input-large">
									<textarea class="text input-large" name="finish_tip">{$data.finish_tip}</textarea>
								</label>
							</div>
						</li>
						<li class="form-item cf">
							<label class="item-label">提交后跳转的地址<span class="check-tips"> （要以http://开头的完整地址，为空时不跳转）</span></label>

							<div class="controls">
								<input type="text" class="text input-large" name="jump_url" value="{$data.jump_url}">
							</div>
						</li>

						<div class="controls">
							<label class="item-label">
								详细介绍
							</label>
							<textarea name="content" style="width:405px; height:100px;">{$data.content}</textarea>
							{:hook('adminArticleEdit', array('name'=>'content','value'=>$data[content]))}
						</div>


					</ul>
			</div>
			<div class="form-item form_bh">
				<button class="btn submit-btn ajax-post" id="submit" type="submit" target-form="form-horizontal">确 定
				</button>
			</div>
			</form>

	</div>
	</section>
	</div>
	</div>
</block>
<block name="script">
	<link href="__STATIC__/datetimepicker/css/datetimepicker.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
	<php>
		if(C('COLOR_STYLE')=='blue_color') echo '
		<link href="__STATIC__/datetimepicker/css/datetimepicker_blue.css?v={:SITE_VERSION}" rel="stylesheet"
		      type="text/css">
		';
	</php>
	<link href="__STATIC__/datetimepicker/css/dropdown.css?v={:SITE_VERSION}" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="__STATIC__/datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript"
	        src="__STATIC__/datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js?v={:SITE_VERSION}"
	        charset="UTF-8"></script>
	<script type="text/javascript">
		$(function () {
			initUploadImg();
		});
		$('#submit').click(function () {
			$('#form').submit();
		});

		$(function () {
			$('.time').datetimepicker({
				format: 'yyyy-mm-dd hh:ii',
				language: "zh-CN",
				minView: 0,
				autoclose: true
			});
			showTab();
		});
	</script>
</block>
